import React from 'react';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import { List, Icon, TextareaItem, ActivityIndicator } from 'antd-mobile';
import content from '../../../common/contentCss/content.css';
import CustTitle from '../../../common/title/title';
import styles from './common.css';

import UploadImg from './pages/uploadImg/uploadImg';

function MyFeedback({dispatch,loading,myFeedback,personal}) {

  const { particulars,uploadImgData } = myFeedback;
  const { registeredUserLoginName } = personal;

  // console.log("profile", JSON.stringify(profile));

  const titleProps = {
    titleName:'意见反馈',
    goBack(){
      dispatch(routerRedux.goBack());
    }
  }

  const UploadImgPorps = {
    dispatch,
    uploadImgData,
    defaultPhoneNumber:registeredUserLoginName,
    onSubmit(data){
      dispatch({
        type:'myFeedback/onSubmit',
        payload:{
          data,
        }
      })

    }
  }



  const MarginHeight = () => <div style={{height: '0.6em', backgroundColor:'#F5F5F9'}}></div>;

  return(
    <div className={content.content} style={{backgroundColor:'#fff'}}>
      <CustTitle {...titleProps}/>
      <div style={{
        marginTop: '2.8125em',
      }}>
      </div>

      <UploadImg {...UploadImgPorps} />

      <ActivityIndicator
        toast
        text=""
        animating={loading}
      />
    </div>
  )
}

function mapStateToProps(state, ownProps) {
  return {
    loading: state.loading.global,
    myFeedback: state.myFeedback,
    personal:state.personal,
  }
}

export default connect(mapStateToProps)(MyFeedback);
